package com.battle.service.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author anni.zhu
 * @author anni.zhu@king-v.com
 * Created in 2024/11/25 13:53
 */
@Data
@Configuration
public class EncryptConfig implements InitializingBean {

    @Value("${encrypt.identification}")
    private String identification;
    @Value("${encrypt.algorithmType}")
    private String algorithmType;
    @Value("${encrypt.encMode}")
    private String encMode;
    @Value("${encrypt.iv}")
    private String iv;
    @Value("${encrypt.padMode}")
    private String padMode;
    @Value("${encrypt.plainIsEncode}")
    private String plainIsEncode;
    @Value("${encrypt.hmacIdentfication}")
    private String hmacIdentfication;
    @Value("${encrypt.url}")
    private String url;
    @Value("${encrypt.encryptUrl}")
    private String encryptUrl;
    @Value("${encrypt.decodeUrl}")
    private String decodeUrl;
    @Value("${encrypt.hmacEncryptUrl}")
    private String hmacEncryptUrl;

    public static String Identification;
    public static String AlgorithmType;
    public static String EncMode;
    public static String Iv;
    public static String PadMode;
    public static String PlainIsEncode;
    public static String HmacIdentfication;
    public static String Url;
    public static String EncryptUrl;
    public static String DecodeUrl;
    public static String HmacEncryptUrl;

    @Override
    public void afterPropertiesSet() throws Exception {
        Identification=identification;
        AlgorithmType=algorithmType;
        EncMode=encMode;
        Iv=iv;
        PadMode=padMode;
        PlainIsEncode=plainIsEncode;
        HmacIdentfication=hmacIdentfication;
        Url=url;
        EncryptUrl=encryptUrl;
        DecodeUrl=decodeUrl;
        HmacEncryptUrl=hmacEncryptUrl;
    }
}
